@extends('admin.base')
@section('title', '订单列表')
@section('content')
 <div class="layui-card">
     <fieldset class="layui-elem-field">
         <div class="layui-field-box">
             <a class="layui-btn-sm" href="{{url('admin/home')}}">首页</a>&raquo;
             <span class="layui-btn-sm" href="{{url('admin/order/index')}}">订单列表</span>
         </div>
     </fieldset>

    <div class="layui-card-header">
      <div>
        <span class="pull-left">
          <div class="layui-form">
            <div class="layui-form-item">
              <div class="layui-inline">     
                <label class="layui-form-label">关键字</label>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" id="sub_keywords" name="keywords" value="{{ isset($request['keywords']) ? $request['keywords'] : ''}}"  placeholder="订单号">
                </div>
                
                <label class="layui-form-label" >时间</label>
                <div class="layui-input-inline">
                    <input  type="text" class="layui-input" class="jeinput" id="test11" placeholder="创建时间(年月日~年月日)" name="month" value="{{ isset($request['month']) ? $request['month'] : '' }}" readonly>
                </div>
                <div class="layui-input-inline">
                  <button class="layui-btn" lay-submit lay-filter="selectsub" >搜索</button>
                </div>
              </div>
            </div>
          </div>
        </span>
      </div>
    </div>

    <div class="layui-card-body">
        <style>
            table tr td.tc,table tr th.tc {
                text-align: center;
                cursor:default;
            }
        </style>
        <table class="layui-table" lay-even lay-size="">
            <colgroup>
                <col width="">
                <col width="">
                <col width="">
                <col width="">
                <col width="">
                <col width="">
            </colgroup>
            <thead>
                <tr>
                    <th class="tc">订单号</th>
                    <th class="tc">昵称</th>
                    <th class="tc">总价</th>
                    <th class="tc">收货人</th>
                    <th class="tc">收货人联系方式</th>
                    <th class="tc">下单时间</th>
                    <th class="tc">发货状态</th>
                    <th class="tc">操作</th>
                </tr>
                <tbody>
                    @if($list->isEmpty())
                        <tr>
                            <td colspan="8" class="tc">暂无数据</td>
                        </tr>
                    @else
                        @foreach ($list as $v)
                            <tr>
                                <td class="tc">{{ $v['sn'] }}</td>
                                <td class="tc">{{ $v['user'] }}</td>
                                <td class="tc">{{ $v['all_price'] }}</td>
                                <td class="tc">{{ $v['linkman'] }}</td>
                                <td class="tc">{{ $v['linktel'] }}</td>
                                <td class="tc">{{ $v['created_at'] }}</td>
                                <td class="tc">{{ $v['sn_state_exit'] }}</td>
                                <td class="tc">
                                    <div class="layui-btn-group" >
                                        <button class="layui-btn layui-btn-sm"><a href="{{url('admin/order/son_order?id='.$v->id)}}" style="color:white">详情</a></button>

                                    </div>
                                </td>

                            </tr>
                        @endforeach
                    @endif
                </tbody>
            </thead>
        </table>
        <!-- 分页 -->
        <div class="sabrosus" >{{ $list->links() }}</div>
    </div>

 </div>
@endsection
@section('js')
    <script>
        layui.use('form', function(){
            var form = layui.form;
            //搜索
            form.on('submit(selectsub)', function(data){
                let keywords = $('#sub_keywords').val();//关键字
                let month = $("#test11").val();//时间
                location.href = "{{url('admin/order/index')}}"+"?keywords="+keywords+"&month="+month;
                return false;
            });

        });
    </script>
@endsection